package tr.edu.yildiz.basevaadin.servlet;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;

import tr.edu.yildiz.basevaadin.vaadin.ModuleDemoApp;
import tr.edu.yildiz.dynaView.service.ModuleService;

import com.vaadin.Application;
import com.vaadin.terminal.gwt.server.AbstractApplicationServlet;
import com.vaadin.ui.Component;


public class BaseVaadinServlet extends AbstractApplicationServlet {

	ModuleService<Component> moduleService;

	public BaseVaadinServlet(ModuleService<Component> moduleService) {
		this.moduleService = moduleService;
	}
	
	@Override
	protected Class<? extends Application> getApplicationClass() {
		return ModuleDemoApp.class;
	}

	@Override
	protected Application getNewApplication(HttpServletRequest request)
			throws ServletException {
		return new ModuleDemoApp(moduleService);
	}
	
}